/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * projetosListar.java
 *
 * Created on Nov 15, 2010, 11:38:41 AM
 */
package NajaTaskClient.interfaces.gerente;

import javax.swing.JDialog;

/**
 *
 * @author Nidorx
 */
public class projetosListar extends javax.swing.JDialog {

    JDialog dialogNovoProjeto;
    JDialog dialogEditarDadosBasicos;
    JDialog dialogEditarArvoreAtividades;

    /** Creates new form projetosListar */
    public projetosListar(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        dialogNovoProjeto = new projetoNovo(parent, true);
        dialogEditarDadosBasicos = new projetoEditarDados(parent, true);
        dialogEditarArvoreAtividades = new projetoEditarArvore(parent, true);
        initComponents();
        this.setLocationRelativeTo(getRootPane());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTableListaProjetos = new javax.swing.JTable();
        buttonEditarDadosBasicos = new javax.swing.JButton();
        buttonSair = new javax.swing.JButton();
        buttonNovoProjeto = new javax.swing.JButton();
        buttonEditarArvoreAtividades = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jTableListaProjetos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"My Mine Finance", null},
                {"Java Tarefas", null}
            },
            new String [] {
                "Projeto", "Ativo"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableListaProjetos.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(jTableListaProjetos);

        buttonEditarDadosBasicos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/NajaTaskClient/recursos/icons/project.png"))); // NOI18N
        buttonEditarDadosBasicos.setText("Editar dados básicos");
        buttonEditarDadosBasicos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonEditarDadosBasicosActionPerformed(evt);
            }
        });

        buttonSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/NajaTaskClient/recursos/icons/exit.png"))); // NOI18N
        buttonSair.setText("Sair");
        buttonSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSairActionPerformed(evt);
            }
        });

        buttonNovoProjeto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/NajaTaskClient/recursos/icons/project_add.png"))); // NOI18N
        buttonNovoProjeto.setText("Novo projeto");
        buttonNovoProjeto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonNovoProjetoActionPerformed(evt);
            }
        });

        buttonEditarArvoreAtividades.setIcon(new javax.swing.ImageIcon(getClass().getResource("/NajaTaskClient/recursos/icons/project.png"))); // NOI18N
        buttonEditarArvoreAtividades.setText("Editar árvore de atividades");
        buttonEditarArvoreAtividades.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonEditarArvoreAtividadesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(buttonSair)
                        .addGap(18, 18, 18)
                        .addComponent(buttonNovoProjeto)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonEditarDadosBasicos)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(buttonEditarArvoreAtividades)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonEditarArvoreAtividades)
                    .addComponent(buttonEditarDadosBasicos)
                    .addComponent(buttonNovoProjeto)
                    .addComponent(buttonSair))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonEditarDadosBasicosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEditarDadosBasicosActionPerformed
        this.exibeDialogEditarDadosBasicos();
}//GEN-LAST:event_buttonEditarDadosBasicosActionPerformed

    private void buttonSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSairActionPerformed
        this.dispose();
}//GEN-LAST:event_buttonSairActionPerformed

    private void buttonNovoProjetoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonNovoProjetoActionPerformed
        this.exibeDialogNovoProjeto();
    }//GEN-LAST:event_buttonNovoProjetoActionPerformed

    private void buttonEditarArvoreAtividadesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEditarArvoreAtividadesActionPerformed
        this.exibeDialogEditarArvoreAtividades();
    }//GEN-LAST:event_buttonEditarArvoreAtividadesActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                projetosListar dialog = new projetosListar(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    private void exibeDialogNovoProjeto() {
        dialogNovoProjeto.setVisible(true);
    }

    private void exibeDialogEditarDadosBasicos() {
        dialogEditarDadosBasicos.setVisible(true);
    }

    private void exibeDialogEditarArvoreAtividades() {
        dialogEditarArvoreAtividades.setVisible(true);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonEditarArvoreAtividades;
    private javax.swing.JButton buttonEditarDadosBasicos;
    private javax.swing.JButton buttonNovoProjeto;
    private javax.swing.JButton buttonSair;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTableListaProjetos;
    // End of variables declaration//GEN-END:variables
}
